package ee.ut.cs.mc.madp.p2pdivider.view;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.VideoView;
import ee.ut.cs.mc.madp.p2pdivider.R;

public class DividedVideoView extends VideoView {

    public DividedVideoView(Context context) {
        super(context);
    }

    public DividedVideoView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        int width = getDefaultSize(0, widthMeasureSpec);
        int height = getDefaultSize(0, heightMeasureSpec);

        // setY(height);
        int titleStripHeight = getRootView().findViewById(R.id.pager_title_strip).getHeight();
        setY((-height - titleStripHeight));
        setMeasuredDimension(width, (height * 2 + titleStripHeight));
    }

}